<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
 <script>
     // var arr = [7,9,6,2,5,1,0,3,8,4];
     // var arr2 = [];
     // for(var i =0;i<arr.length;i++ ){
     //     if(i%2 !== 0 ){
     //         console.log(arr2.push(arr[i]))
     //     }
     // }
     // function chu(){
     //     console.log(arr2.length/arr.length*100+"%")
     // }
     // chu()


     // var arr = [7,9,6,2,5,1,0,3,8,4];
     //  var max =Math.max(...arr);
     //  console.log(max)
     //  console.log(arr.indexOf(max));
     //  var min =Math.min(...arr);
     //  console.log(min)
     //  console.log(arr.indexOf(min));


     var arr =[7,9,6,2,5,1,0,3,8,4]
     function paixu(){

         for(var i=0;i<arr.length-1;i++){
             for(var j=0;j<arr.length-1-i;j++){
                 if(arr[j] > arr[j+1] ){
                     a=arr[j];
                     arr[j]=arr[j+1];
                     arr[j+1] =a;
                 }
             }
         }
     }
     paixu()
     console.log(arr)


 </script>
</body>
</html>